package cn.bdqn.service.impl;

import cn.bdqn.domain.Registration;
import cn.bdqn.mapper.RegistrationMapper;
import cn.bdqn.service.RegistrationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author 挂号表的业务实现
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class RegistrationServiceImpl implements RegistrationService {

    @Autowired
    private RegistrationMapper registrationMapper;

    /**
     * 插入挂号信息
     * @param registration 挂号信息内容
     * @return
     */
    @Override
    public int insertRegistration(Registration registration) {
        return registrationMapper.insertRegistration(registration);
    }

    /**
     * 根据用户openId查询用户挂号信息
     * @param openId
     * @return
     */
    @Override
    public List<Registration> selectRegistrations(String openId) {
        return registrationMapper.selectRegistrations(openId);
    }






}
